﻿<Activity mc:Ignorable="sap sap2010 sads" x:Class="CompleteCustomerDetails.Complete_Customer_Details.Workflow" sap2010:ExpressionActivityEditor.ExpressionActivityEditor="C#" sap2010:WorkflowViewState.IdRef="CompleteCustomerDetails.Complete_Customer_Details.Workflow_1"
 xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 xmlns:mca="clr-namespace:Microsoft.CSharp.Activities;assembly=System.Activities"
 xmlns:msdad="clr-namespace:Microsoft.SharePoint.DesignTime.Activities.Design;assembly=Microsoft.SharePoint.DesignTime.Activities.Design"
 xmlns:p="http://schemas.microsoft.com/workflow/2012/07/xaml/activities"
 xmlns:p1="wf://workflow.windows.net/$Activities"
 xmlns:p2="wf://workflow.windows.net/$Current/$Activities/CompleteCustomerDetails"
 xmlns:s="clr-namespace:System;assembly=mscorlib"
 xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
 xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
 xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation"
 xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"
 xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <TextExpression.NamespacesForImplementation>
    <sco:Collection x:TypeArguments="x:String">
      <x:String>System</x:String>
      <x:String>System.Collections.Generic</x:String>
      <x:String>System.Data</x:String>
      <x:String>System.Text</x:String>
      <x:String>Microsoft.Activities</x:String>
    </sco:Collection>
  </TextExpression.NamespacesForImplementation>
  <TextExpression.ReferencesForImplementation>
    <sco:Collection x:TypeArguments="AssemblyReference">
      <AssemblyReference>Microsoft.Activities</AssemblyReference>
      <AssemblyReference>Microsoft.SharePoint.DesignTime.Activities</AssemblyReference>
      <AssemblyReference>PresentationFramework</AssemblyReference>
      <AssemblyReference>System</AssemblyReference>
      <AssemblyReference>System.Activities</AssemblyReference>
      <AssemblyReference>System.Data</AssemblyReference>
      <AssemblyReference>System.Runtime.Serialization</AssemblyReference>
      <AssemblyReference>System.ServiceModel.Activities</AssemblyReference>
      <AssemblyReference>System.Xaml</AssemblyReference>
      <AssemblyReference>System.Xml</AssemblyReference>
      <AssemblyReference>System.Xml.Linq</AssemblyReference>
      <AssemblyReference>System.Core</AssemblyReference>
      <AssemblyReference>mscorlib</AssemblyReference>
      <AssemblyReference>CompleteCustomerDetails</AssemblyReference>
    </sco:Collection>
  </TextExpression.ReferencesForImplementation>
  <Sequence DisplayName="Root" sap2010:WorkflowViewState.IdRef="Sequence_2">
    <Sequence.Variables>
      <Variable x:TypeArguments="x:String" Name="CustomerName" />
      <Variable x:TypeArguments="x:String" Name="CustomerTitle" />
      <Variable x:TypeArguments="x:String" Name="CustomerAddress" />
      <Variable x:TypeArguments="x:String" Name="CustomerCountry" />
      <Variable x:TypeArguments="x:String" Name="CustomerPhone" />
      <Variable x:TypeArguments="x:String" Name="CustomerFax" />
      <Variable x:TypeArguments="p:DynamicValue" Name="NorthwindServiceResponse" />
      <Variable x:TypeArguments="x:String" Name="CustomerId" />
    </Sequence.Variables>
    <Sequence sap2010:Annotation.AnnotationText="Collect the CustomerID entered by the user in the item." DisplayName="Init" sap2010:WorkflowViewState.IdRef="Sequence_1">
      <Sequence.Variables>
        <Variable x:TypeArguments="p:DynamicValue" Name="CustomerItemProperties" />
      </Sequence.Variables>
      <WriteLine sap2010:WorkflowViewState.IdRef="WriteLine_1" Text="Workflow starting..." />
      <p1:WriteToHistory sap2010:WorkflowViewState.IdRef="WriteToHistory_1" Message="Workflow starting..." />
      <p:SetUserStatus Description="Collecting CustomerID from SharePoint Item" sap2010:WorkflowViewState.IdRef="SetUserStatus_1" />
      <p1:LookupSPListItem ItemGuid="{x:Null}" Properties="{x:Null}" sap2010:Annotation.AnnotationText="Use this activity to get a reference to the list item that triggered the workflow. Then click &quot;Get Properties&quot; to have the designer add the GetDynamicValueProperties activity that will pull the CustomerID from the DynamicValue response (aka: a REST call to SP with a JSON response for the item) and store it in a local variable." sap2010:WorkflowViewState.IdRef="LookupSPListItem_1">
        <p1:LookupSPListItem.ItemId>
          <InArgument x:TypeArguments="x:Int32">
            <p:ExpressionContainerValue x:TypeArguments="x:Int32">
              <p1:GetCurrentItemId />
            </p:ExpressionContainerValue>
          </InArgument>
        </p1:LookupSPListItem.ItemId>
        <p1:LookupSPListItem.ListId>
          <InArgument x:TypeArguments="s:Guid">
            <p:ExpressionContainerValue x:TypeArguments="s:Guid">
              <p1:GetCurrentListId />
            </p:ExpressionContainerValue>
          </InArgument>
        </p1:LookupSPListItem.ListId>
        <p1:LookupSPListItem.Result>
          <OutArgument x:TypeArguments="p:DynamicValue">
            <mca:CSharpReference x:TypeArguments="p:DynamicValue">CustomerItemProperties</mca:CSharpReference>
          </OutArgument>
        </p1:LookupSPListItem.Result>
      </p1:LookupSPListItem>
      <p:GetODataProperties DisplayName="GetDynamicValueProperties" sap2010:WorkflowViewState.IdRef="GetODataProperties_1">
        <p:GetODataProperties.Source>
          <InArgument x:TypeArguments="p:DynamicValue">
            <mca:CSharpValue x:TypeArguments="p:DynamicValue">CustomerItemProperties</mca:CSharpValue>
          </InArgument>
        </p:GetODataProperties.Source>
        <scg:Dictionary x:TypeArguments="x:String, OutArgument">
          <OutArgument x:TypeArguments="x:String" x:Key="Title">
            <mca:CSharpReference x:TypeArguments="x:String">CustomerId</mca:CSharpReference>
          </OutArgument>
        </scg:Dictionary>
      </p:GetODataProperties>
      <p1:WriteToHistory sap2010:WorkflowViewState.IdRef="WriteToHistory_2">
        <p1:WriteToHistory.Message>
          <InArgument x:TypeArguments="x:String">
            <mca:CSharpValue x:TypeArguments="x:String">"CustomerID = " + CustomerId</mca:CSharpValue>
          </InArgument>
        </p1:WriteToHistory.Message>
      </p1:WriteToHistory>
    </Sequence>
    <p2:GetNorthwindCustomerDetails sap2010:Annotation.AnnotationText="Use a custom activity to query the Northwind OData service." sap2010:WorkflowViewState.IdRef="GetNorthwindCustomerDetails_1">
      <p2:GetNorthwindCustomerDetails.CustomerAddress>
        <OutArgument x:TypeArguments="x:String">
          <mca:CSharpReference x:TypeArguments="x:String">CustomerAddress</mca:CSharpReference>
        </OutArgument>
      </p2:GetNorthwindCustomerDetails.CustomerAddress>
      <p2:GetNorthwindCustomerDetails.CustomerCountry>
        <OutArgument x:TypeArguments="x:String">
          <mca:CSharpReference x:TypeArguments="x:String">CustomerCountry</mca:CSharpReference>
        </OutArgument>
      </p2:GetNorthwindCustomerDetails.CustomerCountry>
      <p2:GetNorthwindCustomerDetails.CustomerFax>
        <OutArgument x:TypeArguments="x:String">
          <mca:CSharpReference x:TypeArguments="x:String">CustomerFax</mca:CSharpReference>
        </OutArgument>
      </p2:GetNorthwindCustomerDetails.CustomerFax>
      <p2:GetNorthwindCustomerDetails.CustomerId>
        <InArgument x:TypeArguments="x:String">
          <mca:CSharpValue x:TypeArguments="x:String">CustomerId</mca:CSharpValue>
        </InArgument>
      </p2:GetNorthwindCustomerDetails.CustomerId>
      <p2:GetNorthwindCustomerDetails.CustomerName>
        <OutArgument x:TypeArguments="x:String">
          <mca:CSharpReference x:TypeArguments="x:String">CustomerName</mca:CSharpReference>
        </OutArgument>
      </p2:GetNorthwindCustomerDetails.CustomerName>
      <p2:GetNorthwindCustomerDetails.CustomerPhone>
        <OutArgument x:TypeArguments="x:String">
          <mca:CSharpReference x:TypeArguments="x:String">CustomerPhone</mca:CSharpReference>
        </OutArgument>
      </p2:GetNorthwindCustomerDetails.CustomerPhone>
      <p2:GetNorthwindCustomerDetails.CustomerTitle>
        <OutArgument x:TypeArguments="x:String">
          <mca:CSharpReference x:TypeArguments="x:String">CustomerTitle</mca:CSharpReference>
        </OutArgument>
      </p2:GetNorthwindCustomerDetails.CustomerTitle>
    </p2:GetNorthwindCustomerDetails>
    <Sequence sap2010:Annotation.AnnotationText="Update the customer list item with the Northwind data." DisplayName="Update Customer Item" sap2010:WorkflowViewState.IdRef="Sequence_6">
      <p:SetUserStatus Description="Updating Customer List Item" sap2010:WorkflowViewState.IdRef="SetUserStatus_4" />
      <WriteLine sap2010:WorkflowViewState.IdRef="WriteLine_10" Text="Updating list item" />
      <p1:WriteToHistory sap2010:WorkflowViewState.IdRef="WriteToHistory_6" Message="Updating customer data..." />
      <p1:UpdateListItem ItemGuid="{x:Null}" ListItemProperties="{x:Null}" sap2010:Annotation.AnnotationText="Update the customer list item that triggered the workflow with the data retrieved from the Northwind service." sap2010:WorkflowViewState.IdRef="UpdateListItem_1">
        <p1:UpdateListItem.ItemId>
          <InArgument x:TypeArguments="x:Int32">
            <p:ExpressionContainerValue x:TypeArguments="x:Int32">
              <p1:GetCurrentItemId />
            </p:ExpressionContainerValue>
          </InArgument>
        </p1:UpdateListItem.ItemId>
        <p1:UpdateListItem.ListId>
          <InArgument x:TypeArguments="s:Guid">
            <p:ExpressionContainerValue x:TypeArguments="s:Guid">
              <p1:GetCurrentListId />
            </p:ExpressionContainerValue>
          </InArgument>
        </p1:UpdateListItem.ListId>
        <p1:UpdateListItem.ListItemPropertiesDynamicValue>
          <InArgument x:TypeArguments="p:DynamicValue">
            <p:SetDynamicValueProperties>
              <scg:Dictionary x:TypeArguments="x:String, InArgument">
                <InArgument x:TypeArguments="x:String" x:Key="ContactName">
                  <mca:CSharpValue x:TypeArguments="x:String">CustomerName</mca:CSharpValue>
                </InArgument>
                <InArgument x:TypeArguments="x:String" x:Key="JobTitle">
                  <mca:CSharpValue x:TypeArguments="x:String">CustomerTitle</mca:CSharpValue>
                </InArgument>
                <InArgument x:TypeArguments="x:String" x:Key="WorkAddress">
                  <mca:CSharpValue x:TypeArguments="x:String">CustomerAddress</mca:CSharpValue>
                </InArgument>
                <InArgument x:TypeArguments="x:String" x:Key="WorkCountry">
                  <mca:CSharpValue x:TypeArguments="x:String">CustomerCountry</mca:CSharpValue>
                </InArgument>
                <InArgument x:TypeArguments="x:String" x:Key="WorkPhone">
                  <mca:CSharpValue x:TypeArguments="x:String">CustomerPhone</mca:CSharpValue>
                </InArgument>
                <InArgument x:TypeArguments="x:String" x:Key="WorkFax">
                  <mca:CSharpValue x:TypeArguments="x:String">CustomerFax</mca:CSharpValue>
                </InArgument>
              </scg:Dictionary>
            </p:SetDynamicValueProperties>
          </InArgument>
        </p1:UpdateListItem.ListItemPropertiesDynamicValue>
      </p1:UpdateListItem>
      <WriteLine sap2010:WorkflowViewState.IdRef="WriteLine_11" Text="Customer updated." />
      <p1:WriteToHistory sap2010:WorkflowViewState.IdRef="WriteToHistory_7" Message="Customer updated." />
    </Sequence>
    <sads:DebugSymbol.Symbol>d1lDOlxEZXZcQ29tcGxldGVDdXN0b21lckRldGFpbHNfQ3VzdG9tQWN0aW9uXENvbXBsZXRlQ3VzdG9tZXJEZXRhaWxzV29ya2Zsb3dcV29ya2Zsb3cueGFtbDIrA70BDgIBATYFZRADAYcBZgWKASYCAUeLAQW7ARACAQI6BzpeAwG5ATsHO24DAbcBPAc8hQEDAbUBPQdRHQMBqAFSB10eAwGTAV4HZBsDAYgBeAt4UwIBfn0LfV0CAXWCAQuCAV4CAWxuC25gAgFjhwELhwFeAgFacwtzXAIBUWkLaWACAUiMAQeMAXYCAUWNAQeNAV0CAUOOAQeOAXMCAUGPAQe4ARsCAQe5AQe5AVwCAQW6AQe6AWsCAQM6RTpbAwG6ATtVO2sDAbgBPCQ8UAMBtgFHDUkqAwG0AU4NTm8DAaoBQA1CKgMBqQFVDVVnAwGeAVoNWl0DAZQBYQ1hZwMBiQGMASSMAUECAUaNAUaNAVoCAUSOAVWOAXACAUKgAQ21ASsCAQqZAQ2bASoCAQmSAQ2UASoCAQi5AUa5AVkCAQa6AVW6AWgCAQRID0gmBAG0AQFBD0EmBAGpAQGpAROpAWACATijAROjAV0CAS+vAROvAV4CASasAROsAWACAR2yAROyAVwCARSmAROmAV4CAQuaAQ+aASYDAQkBkwEPkwEmAwEIAQ==</sads:DebugSymbol.Symbol>
  </Sequence>
  <sap2010:WorkflowViewState.ViewStateManager>
    <sap2010:ViewStateManager>
      <sap2010:ViewStateData Id="WriteLine_1" sap:VirtualizedContainerService.HintSize="247,62" />
      <sap2010:ViewStateData Id="WriteToHistory_1" sap:VirtualizedContainerService.HintSize="247,68" />
      <sap2010:ViewStateData Id="SetUserStatus_1" sap:VirtualizedContainerService.HintSize="247,22" />
      <sap2010:ViewStateData Id="LookupSPListItem_1" sap:VirtualizedContainerService.HintSize="247,277">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <scg:Dictionary x:TypeArguments="x:String, msdad:ViewStateNameValue" x:Key="SPLocalizedDisplayNames">
              <msdad:ViewStateNameValue x:Key="ListId" DisplayName="(current list)" Value="$CurrentListId" />
              <msdad:ViewStateNameValue x:Key="ItemId" DisplayName="(current item)" Value="$CurrentItemId" />
            </scg:Dictionary>
            <x:Boolean x:Key="IsAnnotationDocked">True</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="GetODataProperties_1" sap:VirtualizedContainerService.HintSize="247,92">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <x:String x:Key="Properties.SelectedEntityType">Lists/Customers</x:String>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="WriteToHistory_2" sap:VirtualizedContainerService.HintSize="247,68" />
      <sap2010:ViewStateData Id="Sequence_1" sap:VirtualizedContainerService.HintSize="200,104">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsExpanded">False</x:Boolean>
            <x:Boolean x:Key="IsAnnotationDocked">True</x:Boolean>
            <x:Boolean x:Key="IsPinned">False</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="GetNorthwindCustomerDetails_1" sap:VirtualizedContainerService.HintSize="200,60">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsAnnotationDocked">True</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="SetUserStatus_4" sap:VirtualizedContainerService.HintSize="211,22" />
      <sap2010:ViewStateData Id="WriteLine_10" sap:VirtualizedContainerService.HintSize="211,62" />
      <sap2010:ViewStateData Id="WriteToHistory_6" sap:VirtualizedContainerService.HintSize="211,68" />
      <sap2010:ViewStateData Id="UpdateListItem_1" sap:VirtualizedContainerService.HintSize="211,136">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <scg:Dictionary x:TypeArguments="x:String, msdad:ViewStateNameValue" x:Key="SPLocalizedDisplayNames">
              <msdad:ViewStateNameValue x:Key="ItemId" DisplayName="(current item)" Value="$CurrentItemId" />
              <msdad:ViewStateNameValue x:Key="ListId" DisplayName="(current list)" Value="$CurrentListId" />
            </scg:Dictionary>
            <x:String x:Key="ListItemPropertiesDynamicValue.SelectedEntityType"></x:String>
            <x:Boolean x:Key="IsAnnotationDocked">True</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="WriteLine_11" sap:VirtualizedContainerService.HintSize="211,62" />
      <sap2010:ViewStateData Id="WriteToHistory_7" sap:VirtualizedContainerService.HintSize="211,68" />
      <sap2010:ViewStateData Id="Sequence_6" sap:VirtualizedContainerService.HintSize="200,89">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsExpanded">False</x:Boolean>
            <x:Boolean x:Key="IsAnnotationDocked">True</x:Boolean>
            <x:Boolean x:Key="IsPinned">False</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="Sequence_2" sap:VirtualizedContainerService.HintSize="222,457">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsExpanded">True</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="CompleteCustomerDetails.Complete_Customer_Details.Workflow_1" sap:VirtualizedContainerService.HintSize="262,537" />
    </sap2010:ViewStateManager>
  </sap2010:WorkflowViewState.ViewStateManager>
</Activity>